package com.hnevc.xiaoming;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.hnevc.xiaoming.activity.MyAppActivity;
import com.hnevc.xiaoming.activity.MyShoping;
import com.hnevc.xiaoming.activity.MyViewPager;
import com.hnevc.xiaoming.httpactivity.MyLogIn;
import com.hnevc.xiaoming.httpactivity.MyNewsActivity;
import com.hnevc.xiaoming.httpactivity.MyVolleyLogIn;
import com.hnevc.xiaoming.httpactivity.MyWeatherActivity;
import com.hnevc.xiaoming.httpactivity.MyWebView;
import com.hnevc.xiaoming.huituactivity.TranslateActivity;
import com.hnevc.xiaoming.shijianactivity.AddGesture;
import com.hnevc.xiaoming.shijianactivity.EventHanding;
import com.hnevc.xiaoming.shijianactivity.FocusActivity;
import com.hnevc.xiaoming.shijianactivity.KeyListenerActivity;
import com.hnevc.xiaoming.shijianactivity.LongActivity;
import com.hnevc.xiaoming.shijianactivity.TouchActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button soping;
    private Button ViewPage;
    private Button Ev_Hd;
    private Button Touch_layout;
    private Button long_an;
    private Button focs_an;
    private Button onKey_listener;
    private Button addgestur;
    private Button mywebview;
    private Button log_in;
    private Button volley_login_layout;
    private Button btn_news;
    private Button weather;
    private Button my_vf_app;
    private Button bitmap;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();

    }

    private void initView() {
        soping = (Button) findViewById(R.id.soping);


        soping.setOnClickListener(this);
        ViewPage = (Button) findViewById(R.id.ViewPage);
        ViewPage.setOnClickListener(this);
        Ev_Hd = (Button) findViewById(R.id.Ev_Hd);
        Ev_Hd.setOnClickListener(this);
        Touch_layout = (Button) findViewById(R.id.Touch_layout);
        Touch_layout.setOnClickListener(this);
        long_an = (Button) findViewById(R.id.long_an);
        long_an.setOnClickListener(this);
        focs_an = (Button) findViewById(R.id.focs_an);
        focs_an.setOnClickListener(this);
        onKey_listener = (Button) findViewById(R.id.onKey_listener);
        onKey_listener.setOnClickListener(this);
        addgestur = (Button) findViewById(R.id.addgestur);
        addgestur.setOnClickListener(this);
        mywebview = (Button) findViewById(R.id.mywebview);
        mywebview.setOnClickListener(this);
        log_in = (Button) findViewById(R.id.log_in);
        log_in.setOnClickListener(this);
        volley_login_layout = (Button) findViewById(R.id.volley_login_layout);
        volley_login_layout.setOnClickListener(this);
        btn_news = (Button) findViewById(R.id.btn_news);
        btn_news.setOnClickListener(this);
        weather = (Button) findViewById(R.id.weather);
        weather.setOnClickListener(this);
        my_vf_app = (Button) findViewById(R.id.my_vf_app);
        my_vf_app.setOnClickListener(this);
        bitmap = (Button) findViewById(R.id.bitmap);
        bitmap.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.soping:
                startActivity(new Intent(MainActivity.this, MyShoping.class));
                break;
            case R.id.ViewPage:
                startActivity(new Intent(MainActivity.this, MyViewPager.class));
                break;
            case R.id.Ev_Hd:
                startActivity(new Intent(MainActivity.this, EventHanding.class));
                break;
            case R.id.Touch_layout:
                startActivity(new Intent(MainActivity.this, TouchActivity.class));
                break;
            case R.id.long_an:
                startActivity(new Intent(MainActivity.this, LongActivity.class));
                break;
            case R.id.focs_an:
                startActivity(new Intent(MainActivity.this, FocusActivity.class));
                break;
            case R.id.onKey_listener:
                startActivity(new Intent(MainActivity.this, KeyListenerActivity.class));
                break;
            case R.id.addgestur:
                startActivity(new Intent(MainActivity.this, AddGesture.class));
                break;
            case R.id.mywebview:
                startActivity(new Intent(MainActivity.this, MyWebView.class));
                break;
            case R.id.log_in:
                startActivity(new Intent(MainActivity.this, MyLogIn.class));
                break;
            case R.id.volley_login_layout:
                startActivity(new Intent(MainActivity.this, MyVolleyLogIn.class));
                break;
            case R.id.btn_news:
                startActivity(new Intent(MainActivity.this, MyNewsActivity.class));
                break;
            case R.id.weather:
                startActivity(new Intent(MainActivity.this, MyWeatherActivity.class));
                break;
            case R.id.my_vf_app:
                startActivity(new Intent(MainActivity.this, MyAppActivity.class));
                break;
            case R.id.bitmap:
                startActivity(new Intent(MainActivity.this, TranslateActivity.class));
                break;
        }
    }
}